<?php
class CheckGroup extends Action {
	/*
	 * (non-PHPdoc) @see Action::execute()
	 */
	public function execute($params) {
		check_login ( ADMIN_LOGIN_PAGE );
		$groupModel = new CoreGroupModel ();
		$where ['gname'] = rqst ( 'gname' );
		$uid = irqst ( 'gid', 0 );
		if (! empty ( $uid )) { //修改时
			$where ['gid !='] = $uid;
		}
		@header ( 'Content-type: application/json', true );
		echo $groupModel->exist ( $where ) ? 'false' : 'true';
	}
}